import os
import cv2
dirs = ['work1','work2','work3']
for dir in dirs:
    if not os.path.exists(dir):
        os.mkdir(dir)
    path = rf"./{dir}"
    for root, dirs, files in os.walk(path):
        print(root)
        print(dirs)
        print(files)
        for file in files:
            print(os.path.join(root, file))
if os.path.exists("./work3"):
    os.rmdir("./work3")
    if os.path.exists("./work3"):
        print("删除失败")
    else:
        print("成功删除work3文件夹")
else:
    print("不存在")
